/*
 * @Author: zingpp
 * @Date: 2025-06-19 18:07:34
 * @LastEditors: zingpp
 * @LastEditTime: 2025-06-20 14:58:10
 * @FilePath: \cool-server\src\modules\product\dto\create-product.dto.ts
 * @Description: 
 * 
 * Copyright (c) 2025 by 用户/公司名, All Rights Reserved. 
 */
import { IsString, IsNumber, IsOptional, IsPositive, Min, MaxLength } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class CreateProductDto {
  @ApiProperty({ description: '商品名称', maxLength: 100 })
  @IsString()
  @MaxLength(100)
  name: string;

  @ApiProperty({ description: '商品描述', required: false })
  @IsOptional()
  @IsString()
  description?: string;

  @ApiProperty({ description: '价格', example: 99.99 })
  @IsNumber()
  @IsPositive()
  price: number;

  @ApiProperty({ description: '库存', example: 100 })
  @IsNumber()
  @Min(0)
  stock: number;

  @ApiProperty({ description: '图片地址', required: false })
  @IsOptional()
  @IsString()
  image?: string;
} 